define(function (require, exports, module) {

    var CommentAnnotType = require("./CommentsAnnot")
    var CPDF_Annot = WebPDF.PDFData.CPDF_Annot;
    var CAnnotFactory = WebPDF.CAnnotFactory;

    WebPDF.Tools.TOOL_NAME_COMMENT_HIGHTLIGHT = CommentAnnotType.COMMENTTYPE_HIGHLIGHT;
    WebPDF.Tools.TOOL_NAME_COMMENT_UNDERLINE =  CommentAnnotType.COMMENTTYPE_UNDERLINE;

    WebPDF.Event.CommentAnnotToolHandler = function (readerApp, annotType, annotPlugin) {
        var _pReaderApp = readerApp,
            _Language = null,
    		_pBaseAnnotPlugin = annotPlugin,
    		_commentAnnotType = annotType,
    		_isProcessing = false,
    		_pTextSelectTool = null,
    		_self = this;

        var DEFAULT_OPCITY = 1.0;
        var MKA_POPUPWIDTH = WebPDF.PDFData.MKA_POPUPWIDTH;
        var MKA_POPUPHEIGHT = WebPDF.PDFData.MKA_POPUPHEIGHT;

        /**
        * @description åˆ�å§‹åŒ–å·¥å…·æ—¶è°ƒç”¨
        * @param {WebPDF.CReaderApp} pReaderApp Appå¯¹è±¡
        */
        this.onInit = function () {          
//            _Language = _pReaderApp.getLanguage();
            if (WebPDF.TextSelect && WebPDF.TextSelect.CReader_TextSelectTool) {
                _pTextSelectTool = new WebPDF.TextSelect.CReader_TextSelectTool.CreateTextSelectTool(_pReaderApp, true);
            }
        };

        this.destroy = function () {
        };

        /**
        * @description èŽ·å�–å·¥å…·çš„å��ç§°
        * @return {String} å·¥å…·çš„å��ç§°;
        */
        this.getName = function () {
            return _commentAnnotType;
        };

        // UI Events
        /**
        * @description æ¿€æ´»å·¥å…·æ—¶è°ƒç”¨
        */
        this.onActivate = function () {
			var pDocView = _pReaderApp.getMainView().getDocView();
            var jqDocViewContainer = $("#" + pDocView.getDocViewContainerID());
            var pCommentAnnotCommand = null;
            if (_commentAnnotType === WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_HIGHLIGHT) {
              //  pCommentAnnotCommand = readerApp.getCommand("HighlightAnnotCommand");
				if (WebPDF.Environment.ie || WebPDF.Environment.ieAtLeast11)
					jqDocViewContainer.addClass("fwr-highlight-cursor-ie");
				else
					jqDocViewContainer.addClass("fwr-highlight-cursor");
            }
            else if (_commentAnnotType === WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_UNDERLINE) {
              //  pCommentAnnotCommand = __readerApp.getCommand("UnderlineAnnotCommand");
				if (WebPDF.Environment.ie || WebPDF.Environment.ieAtLeast11)
					jqDocViewContainer.addClass("fwr-underline-cursor-ie");
				else
					jqDocViewContainer.addClass("fwr-underline-cursor");
            }
			
           // pCommentAnnotCommand && pCommentAnnotCommand.setState(true);
        };


        /**
        * @description å�œç”¨å·¥å…·æ—¶è°ƒç”¨
        */
        this.onDeactivate = function () {
            var pCommentAnnotCommand = null;
			var pDocView = _pReaderApp.getMainView().getDocView();
		    
            var jqDocViewContainer = $("#" + pDocView.getDocViewContainerID());
            if (_commentAnnotType === WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_HIGHLIGHT) {
				if (WebPDF.Environment.ie || WebPDF.Environment.ieAtLeast11)
                    jqDocViewContainer.removeClass("fwr-highlight-cursor-ie");
                else
                    jqDocViewContainer.removeClass("fwr-highlight-cursor");
             //   pCommentAnnotCommand = readerApp.getCommand("HighlightAnnotCommand");
            }
            else if (_commentAnnotType === WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_UNDERLINE) {
				if (WebPDF.Environment.ie || WebPDF.Environment.ieAtLeast11)
                    jqDocViewContainer.removeClass("fwr_underline-cursor-ie");
                else
                    jqDocViewContainer.removeClass("fwr-underline-cursor");
              //  pCommentAnnotCommand = readerApp.getCommand("UnderlineAnnotCommand");
            }
//            pCommentAnnotCommand && pCommentAnnotCommand.SetState(false);
        };

        // Calculate status
        /**
        * @description åˆ¤æ–­è¯¥å·¥å…·æ˜¯å�¦å�¯ç”¨
        * @return {Boolean} å�¯ç”¨è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.isEnabled = function () {
            var pCurrentDocument = _pReaderApp.GetMainView().GetDocView().GetPDFDoc();
            if (pCurrentDocument) {
                if (pCurrentDocument.GetDocType() != WebPDF.PDFData.DocType.XFA)
                    return true;
            }
            /*
            * if (!(pDoc->GetDocumentType() == DOCTYPE_DYNIMIC_XFA))
            return pDoc->GetPermissions(FPDFPERM_ANNOT_FORM) ; 
            * */
            return true;
        };

        /**
        * @description åˆ¤æ–­è¯¥å·¥å…·æ˜¯å�¦æ­£å¤„äºŽæ–‡æœ¬é€‰æ‹©çŠ¶æ€�
        * @return {Boolean} æ­£å¤„äºŽæ–‡æœ¬é€‰æ‹©çŠ¶æ€�è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.isProcessing = function () {
            return _isProcessing;
        };

        // Mouse events
        /**
        * @description é¼ æ ‡å·¦é”®æŒ‰ä¸‹äº‹ä»¶å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onLButtonDown = function (event) {
			var regex_annot = new RegExp("(^|\\s)" + "fwr-annot" + "(\\s|$)");
            var bAnnot = regex_annot.test(event.target.className);
			var pPageView = null;
			var pDocView = _pReaderApp.getMainView().getDocView();
            if (bAnnot)
			{
				var nPageIndex = parseInt(event.target.getAttribute("page-index"));
                var annotName = event.target.getAttribute("annot-name");
				pPageView = pDocView.getPageView(nPageIndex);
                var pPDFPage = pPageView.getPDFPage();
                var annot = pPDFPage.getAnnotByName(annotName);
				if (annot && annot.getType() === "Markup") {
					if (annot.getSubType() === _commentAnnotType)
						return false;
				}
			}

            var jqDocViewContainer = $("#" + pDocView.getDocViewContainerID());
            if (!WebPDF.Common.containsNode(jqDocViewContainer.get(0), event.target, true)) {
                return false;
            }
			if(pPageView == null)
			{
				 var ptOffsetCurPageView = new WebPDF.PDFPoint(0, 0);
				pPageView = WebPDF.TextSelect.CReader_TextSelectTool.getPageViewInfoByMouseEvent(_pReaderApp, event, ptOffsetCurPageView, true, false);
				if (pPageView == null)
				 return false;
			}

            var pFocusAnnot = pPageView.getFocusAnnot();
            if (pFocusAnnot) {
                pPageView.setFocusAnnot(null);
            }
            //pPageView.getDocView().clearAllSelection();
            _pTextSelectTool.clearSelection();
            _pTextSelectTool.onLButtonDown(event);
            _isProcessing = true;
            return true;
        };

        /**
        * @description é¼ æ ‡å·¦é”®å¼¹èµ·äº‹ä»¶å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onLButtonUp = function (event) {
            _ClearHighLightRectsSelected();
            if (_isProcessing) {
                _pTextSelectTool.onLButtonUp(event, function () {
                    _self.createAnnot();
                    _pReaderApp.getMainView().getDocView().setModified(true);
//                    _pBaseAnnotPlugin.setSaveCommentBtnState(true);
                });
            }
            _pTextSelectTool.clearSelection();
            _isProcessing = false;
            return true;
        };

        function _ClearHighLightRectsSelected(pageIndex, bNoClearData) {
			var pDocView = _pReaderApp.getMainView().getDocView();
            if (pageIndex && pageIndex >= 0) {
                var pPageView = pDocView.GetPageView(pageIndex);
                if (pPageView) {
                    var highLightSelectedDivID = pPageView.getPageViewContainerID() + "_TextSelectedHighLightsSelected";
                    var jqHighlightSelectedDiv = $("#" + highLightSelectedDivID);
                    if (jqHighlightSelectedDiv.length > 0) {
                        jqHighlightSelectedDiv.empty();
                    }
                }

                /*   if (!bNoClearData) {
                if (pageIndex == _downInHightTextInfo.pageIndex) {
                _downInHightTextInfo.pageIndex = -1;
                _downInHightTextInfo.hightTextRectIndex = -1;
                }
                }*/
                return;

            }
            var pageCount = pDocView.getPageCount();
            for (var i = 0; i < pageCount; i++) {
                var pPageView = pDocView.getPageView(i);
                if (pPageView) {
                    var highLightSelectedDivID = pPageView.getPageViewContainerID() + "_TextSelectedHighLightsSelected";
                    var jqHighlightSelectedDiv = $("#" + highLightSelectedDivID);
                    if (jqHighlightSelectedDiv.length > 0) {
                        jqHighlightSelectedDiv.empty();
                    }
                }
            }

            /*if (!bNoClearData) {
            _downInHightTextInfo.pageIndex = -1;
            _downInHightTextInfo.hightTextRectIndex = -1;
            }*/
        }

        function _GetDefaultColor(annotType) {
            if (annotType === WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_UNDERLINE) {
                return "#329f00";
            }
            else if (annotType === WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_HIGHLIGHT) {
                return "#ffed00";
            }
            else return "#f78f20";
        }

        function _GetDefaultSubj(annotType) {
            if (annotType === WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_UNDERLINE)
                return "Underline";
            else if (annotType == WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_HIGHLIGHT)
                return "Highlight";
            else if (annotType == WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_SQUIGGLY)
                return "Squiggly";
            else if (annotType == WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_STRIKEOUT)
                return "Strikeout";
            else if (annotType == WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_CARET)
                return "Caret";
            else if (annotType == WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_REPLACE)
                return "Replace";
            return "";
        }

		function _SwapArrayElement(i,j,elemArray)
		{
			var temp = elemArray[i];
			elemArray[i] = elemArray[j];
			elemArray[j] = temp;
		}

		function _QuadPtsFromRect(jsonQuad,rect,reversePageMatrix,reverseTextMatrix,textMatrix,textWritingMode)
		{
				// rst[0]: left    rst[1]: top
			// rst[2]: right   rst[3]: bottom
			var transform = reversePageMatrix.TransFormRect(rect.left,rect.top,rect.right,rect.bottom);
			var tannsformTextRc = reverseTextMatrix.TransFormRect(transform[0],transform[1],transform[2],transform[3]);
			switch(textWritingMode)
			{
				case WebPDF.PDFData.Text.WritingMode.TEXT_WRITING_MODE_LRTB:
				{
					if(tannsformTextRc[2] < tannsformTextRc[0])
					{
						_SwapArrayElement(2,0,tannsformTextRc);
					}
					if(tannsformTextRc[1] > tannsformTextRc[3])
					{
						_SwapArrayElement(1,3,tannsformTextRc);
					}
				}break;
				case WebPDF.PDFData.Text.WritingMode.TEXT_WRITING_MODE_RLTB:
				{
					if(tannsformTextRc[0] > tannsformTextRc[2])
					{
						_SwapArrayElement(2,0,tannsformTextRc);
					}
					if(tannsformTextRc[1] > tannsformTextRc[3])
					{
						_SwapArrayElement(1,3,tannsformTextRc);
					}
				}break;
				case WebPDF.PDFData.Text.WritingMode.TEXT_WRITING_MODE_LRBT:
				{
					if(tannsformTextRc[2] < tannsformTextRc[0])
					{
						_SwapArrayElement(2,0,tannsformTextRc);
					}
					if(tannsformTextRc[1] < tannsformTextRc[3])
					{
						_SwapArrayElement(1,3,tannsformTextRc);
					}
				}break;
				case WebPDF.PDFData.Text.WritingMode.TEXT_WRITING_MODE_RLBT:
				{
					if(tannsformTextRc[0] > tannsformTextRc[2])
					{
						_SwapArrayElement(2,0,tannsformTextRc);
					}
					if(tannsformTextRc[1] < tannsformTextRc[3])
					{
						_SwapArrayElement(1,3,tannsformTextRc);
					}
				}break;
			}
			/*if(tannsformTextRc[1] < tannsformTextRc[3])
			{
				var temp = tannsformTextRc[1];
				tannsformTextRc[1] = tannsformTextRc[3];
				tannsformTextRc[3] = temp;
			}*/
			var pt1 = textMatrix.TransFormPoint(tannsformTextRc[0], tannsformTextRc[3]);
			var pt2 = textMatrix.TransFormPoint(tannsformTextRc[2], tannsformTextRc[3]);
			var pt3 = textMatrix.TransFormPoint(tannsformTextRc[2], tannsformTextRc[1]);
			var pt4 = textMatrix.TransFormPoint(tannsformTextRc[0], tannsformTextRc[1]);
			jsonQuad.push(pt1[0], pt4[1], pt2[0], pt3[1], pt4[0], pt1[1], pt3[0], pt2[1]);
		}

        function _CreateAnnot(pPDFPage, rectArray,matrixArray,writingModeArray) {
            if (rectArray.length < 0)
                return false;
            var dt = new Date();
            var time = dt.valueOf() + dt.getTimezoneOffset() * 60000;
            var timestamp = (Math.floor(time / 1000)).toString();
            var annots_json = {
                c: "",
                ca: DEFAULT_OPCITY,
                cd: timestamp,
                cl: _GetDefaultColor(_commentAnnotType),
                f: WebPDF.PDFData.AnnotFlag.ANNOTFLAG_PRINT,
                md: timestamp,
                n: timestamp,
                pop: null,
                subj: _GetDefaultSubj(_commentAnnotType),
                subty: _commentAnnotType,
                tit:  _pReaderApp.getUserName(),
                ty: "Markup",
                Quad: [],
                rc: null
            };
            WebPDF.RectUtils.normalize(rectArray[0]);
            var totalRect = rectArray[0];
			var pageMatrix = pPDFPage.getPageMatrix();
			var reverPageMatrix = new WebPDF.PDFMatrix();
			reverPageMatrix.SetReverse(pageMatrix);
			var reverseTextMatrix = new WebPDF.PDFMatrix();
			reverseTextMatrix.SetReverse(matrixArray[0]);
			_QuadPtsFromRect(annots_json.Quad,totalRect,reverPageMatrix,reverseTextMatrix,matrixArray[0],writingModeArray[0]);
            for (var i = 1; i < rectArray.length; i++) {
                var rect = rectArray[i];
				reverseTextMatrix = new WebPDF.PDFMatrix();
				reverseTextMatrix.SetReverse(matrixArray[i]);
				_QuadPtsFromRect(annots_json.Quad,rect,reverPageMatrix,reverseTextMatrix,matrixArray[i],writingModeArray[i]);
                WebPDF.RectUtils.normalize(rect);
                WebPDF.RectUtils.union(totalRect, rect);
            }
            annots_json.rc = [totalRect.left, totalRect.top, totalRect.right, totalRect.bottom];

            var popupRect = new WebPDF.PDFRect(0, 0, 0, 0);
            popupRect.top = totalRect.top;
            
			var pPageView = _pReaderApp.getMainView().getDocView().getPageView(pPDFPage.getPageIndex());
            var nPixelsPerPt = _pReaderApp.getPixelsPerPoint();
			var viewScale = pPageView.getDocView().getScale();
            popupRect.left = (pPageView.getPageViewWidth()-MKA_POPUPWIDTH*nPixelsPerPt)/(viewScale*nPixelsPerPt);
            popupRect.right = popupRect.left + MKA_POPUPWIDTH;
            popupRect.bottom = popupRect.top - MKA_POPUPHEIGHT;

            annots_json.pop =
        	 {
        	     f: WebPDF.PDFData.AnnotFlag.ANNOTFLAG_PRINT,
        	     md: timestamp,
        	     n: timestamp + "_popup",
        	     op: 0,
        	     rc: [popupRect.left, popupRect.top, popupRect.right, popupRect.bottom]
        	 };

            var pAnnot = WebPDF.AnnotFactory.createAnnot(annots_json, false);
            pPDFPage.getAnnotJsonData().push(annots_json);
            pPDFPage.addAnnot(pAnnot);
            pPageView.setModified(true);
            
//            var pPageView = _pReaderApp.GetMainView().GetDocView().GetPageView(pPDFPage.GetPageIndex());
            var annotHandlerMgr = _pReaderApp.getPluginByName(WebPDF.BASEANNOT_PLUGIN_NAME).getAnnotHandlerMgr();
            var t = annotHandlerMgr.getUIManager();
            var pageAnnotsDiv = t.getPageAnnotsContainerID(pPageView);
            var jqPageAnnotsDiv = $("#" + pageAnnotsDiv);
            
            var newAnnotHtml = annotHandlerMgr.getUIManager().createAAnnotHtmlContent(pPageView, pAnnot, pAnnot.getAnnotName());
            jqPageAnnotsDiv.append(newAnnotHtml);
//            annotHandlerMgr.bindPopupContextmenuEvent();
        }



        this.createAnnot = function () {
            var nStartPageIndex = 0, nEndPageIndex = 0;
            var selectRange = _pTextSelectTool.getSelectedPageRange(nStartPageIndex, nEndPageIndex);
            nStartPageIndex = selectRange.start;
            nEndPageIndex = selectRange.end;
            if (nEndPageIndex < 0 || nStartPageIndex < 0)
                return false;

            var iPageNum = Math.abs(nEndPageIndex - nStartPageIndex) + 1;
            var iStep = nEndPageIndex - nStartPageIndex >= 0 ? 1 : -1;
            for (var iPageIndex = nStartPageIndex, iIndex = 0; iIndex < iPageNum; iPageIndex += iStep, iIndex++) {
                var textPage = _pTextSelectTool.getTextPage(iPageIndex);
                if (!textPage) return;
                var rect_array = [];
				var matrixArray = [];
				var writingModeArray = [];
                textPage.pageSelectInfo.getSelectPDFRectAndMatrix(rect_array,matrixArray,writingModeArray);

                if (rect_array.length > 0) {
                    var pPDFPage = _pReaderApp.getMainView().getDocView().getPageView(iPageIndex).getPDFPage();
                    _CreateAnnot(pPDFPage, rect_array,matrixArray,writingModeArray);
                }
            }
            _pTextSelectTool.clearSelection();
            return true;
        };



        /**
        * @description é¼ æ ‡å·¦é”®å�Œå‡»äº‹ä»¶å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onLButtonDblClk = function (event) {
			var regex_annot = new RegExp("(^|\\s)" + "fwr-annot" + "(\\s|$)");
            var bAnnot = regex_annot.test(event.target.className);
			var pPageView = null;
			var pDocView = _pReaderApp.getMainView().getDocView();
            if (bAnnot)
			{
				var nPageIndex = parseInt(event.target.getAttribute("page-index"));
                var annotName = event.target.getAttribute("annot-name");
				pPageView = pDocView.getPageView(nPageIndex);
                var pPDFPage = pPageView.getPDFPage();
                var annot = pPDFPage.getAnnotByName(annotName);
				if (annot && annot.getType() === "Markup") {
					if (annot.getSubType() === _commentAnnotType)
					{
						return false;
					}
				}
			}
            var jqDocViewContainer = $("#" + pDocView.getDocViewContainerID());
            if (!WebPDF.Common.containsNode(jqDocViewContainer.get(0), event.target, true)) {
                return false;
            }

			if(pPageView == null)
			{
				 var ptOffsetCurPageView = new WebPDF.PDFPoint(0, 0);
				  pPageView = WebPDF.TextSelect.CReader_TextSelectTool.getPageViewInfoByMouseEvent(_pReaderApp, event, ptOffsetCurPageView, true, false);
			}
           
            if (pPageView == null)
                return false;
            var pFocusAnnot = pPageView.getFocusAnnot();
            if (pFocusAnnot) {
                pPageView.SetFocusAnnot(null);
            }
            //pDocView.clearAllSelection();

            _pTextSelectTool.onLButtonDblClk(event, function () {
                _self.createAnnot();
                _pReaderApp.getMainView().getDocView().setModified(true);
//                _pBaseAnnotPlugin.SetSaveCommentBtnState(true);
            });
            return true;
        };
        /**
        * @description ä¸»çª—ä½“çš„é¼ æ ‡ç§»åŠ¨äº‹ä»¶å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onMouseMove = function (event) {
            _pTextSelectTool.onMouseMove(event);
            return true;
        };
        /**
        * @description é¼ æ ‡å�³é”®æŒ‰ä¸‹äº‹ä»¶å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onRButtonDown = function (event) {
            return false;
        };
        /**
        * @description é¼ æ ‡å�³é”®å¼¹èµ·äº‹ä»¶å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onRButtonUp = function (event) {
            return false;
        };
        /**
        * @description é¼ æ ‡å�³é”®å�Œå‡»äº‹ä»¶å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onRButtonDblClk = function (event) {
            return false;
        };
        /**
        * @description é¼ æ ‡æ»šè½®æ»šåŠ¨äº‹ä»¶å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onMouseWheel = function (event) {
            return false;
        };
        /**
        * @description é¼ æ ‡ç§»è¿›äº‹ä»¶ï¼ˆé¼ æ ‡ç§»åŠ¨åˆ°å®ƒå­�å…ƒç´ æ—¶ä¹Ÿä¼šè§¦å�‘è¯¥äº‹ä»¶ï¼‰å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onMouseOver = function (event) {
            return false;
        };
        /**
        * @description é¼ æ ‡ç§»å‡ºäº‹ä»¶ï¼ˆé¼ æ ‡ç§»åŠ¨åˆ°å®ƒå­�å…ƒç´ æ—¶ä¹Ÿä¼šè§¦å�‘è¯¥äº‹ä»¶ï¼‰å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onMouseOut = function (event) {
            return false;
        };
        /**
        * @description é¼ æ ‡è¿›å…¥äº‹ä»¶ï¼ˆé¼ æ ‡å�ªæœ‰è¿›å…¥è¯¥å…ƒç´ åŒºåŸŸæ‰�ä¼šè§¦å�‘è¯¥äº‹ä»¶ï¼‰å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onMouseEnter = function (event) {
            return false;
        };
        /**
        * @description é¼ æ ‡ç¦»å¼€äº‹ä»¶ï¼ˆé¼ æ ‡å�ªæœ‰ç¦»å¼€è¯¥å…ƒç´ åŒºåŸŸæ‰�ä¼šè§¦å�‘è¯¥äº‹ä»¶ï¼‰å¤„ç�†
        * @param {Object} event é¼ æ ‡äº‹ä»¶å¯¹è±¡
        * @return {Boolean} å¤„ç�†è¿”å›žtrue,å�¦åˆ™è¿”å›žfalse;
        */
        this.onMouseLeave = function (event) {
            return false;
        };
        this.onKeyDown = function (event) {
            return false;
        }
        this.onKeyUp = function (event) {
            return false;
        }
        this.onChar = function (event) {
            return false;
        }
    };

    return WebPDF.Event.CommentAnnotToolHandler;
});